home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Essentials / Technical.Notes / IIGS / TN.IIGS.016 < prev    next >
Encoding:
Text File  |  1988-12-16  |  3.8 KB  |  95 lines  |  [TEXT/pdos]

  1. Apple II
  2. Technical Notes
  3. _____________________________________________________________________________
  4.                                                   Developer Technical Support
  5.  
  6.  
  7. Apple IIGS
  8. #16:    Notes on Background Printing
  9.  
  10. Revised by:    Mike Askins                                      November 1988
  11. Written by:    Mike Askins                                          June 1987
  12.  
  13. This Technical Note attempts to pinpoint some of the common problems people 
  14. encounter when using background printing as available through the serial 
  15. firmware.
  16. _____________________________________________________________________________
  17.  
  18.  
  19. Calling Sequence
  20.  
  21.     Init call     Starts the serial firmware
  22.     SetOutBuff    Specifies a buffer to place data to be printed
  23.                   Places data in buffer ( amount < buffer size)
  24.     SendQueue     Starts the background printing process
  25.  
  26.  
  27. Correctly Making the SendQueue Call
  28.  
  29. The Apple IIGS Firmware Reference incorrectly documents the parameters you 
  30. pass to SendQueue.  The correct specification of the recharge address does not 
  31. correspond to the standard method of passing a full 32-bit address.  Set the 
  32. parameters as follows:
  33.  
  34.     SendQueue
  35.     Launches background printing.
  36.  
  37.         CmdList    DFB $04                       ;Parameter Count
  38.                    DFB$18                        ;Command Code
  39.                    DW $00                        ;Result Code (output)
  40.                    DW  DataLength
  41.                    DFB RechargeAddress (bank)
  42.                    DFB RechargeAddress (high)
  43.                    DFB RechargeAddress (low)
  44.                    DFB $00
  45.  
  46.  
  47. Using the Default Buffer
  48.  
  49. You can use the area which the firmware reserves for transparent buffering to 
  50. place data for background printing.  This is advantageous since the firmware 
  51. calls the Memory Manager to allocate space for the buffer (you must allocate 
  52. the space from the Memory Manager if you use the SetOutBuff call to set up a 
  53. buffer).
  54.  
  55. To use the serial firmware's buffer, you must first enable buffering by 
  56. initializing the port with PINIT and sending it the string "^IBE" with PWRITE.  
  57. Once you enable buffering, call GetOutBuff to find the size and location of 
  58. the buffer, then place your data (buffersize - 1) in the buffer and call 
  59. SendQueue.
  60.  
  61.  
  62. Data Size
  63.  
  64. Make sure that the amount of data you place in the buffer is at least one byte 
  65. less than the size of the buffer since the firmware uses one byte of the 
  66. buffer for bookkeeping purposes; if you place too much data in the buffer, it 
  67. will continually print the buffer's contents and never call your recharge 
  68. routine.
  69.  
  70.  
  71. The Recharge Routine
  72.  
  73. You should treat the recharge routine as an interrupt handler and execute it 
  74. at interrupt time.  Interrupts are disabled at this time, and it is illegal to 
  75. enable them within the recharge routine.  Like all interrupt handlers, the 
  76. recharge routine should take care of its business as quickly as possible then 
  77. exit; any excessive delays cause interrupt dependent processes (e.g., 
  78. AppleTalk) to fail.  You should also remember that most of the system code is 
  79. non-reentrant; you should use the Scheduler when calling system code which may 
  80. have been running when the serial interrupt that invoked the recharge routine 
  81. occurred.
  82.  
  83. The serial firmware is not generally reentrant and does not interact with the 
  84. Scheduler.  If you want to make serial firmware calls (through $C1xx, $C2xx) 
  85. from your recharge routine, you must preserve MSLOT (the byte at $0007F8) 
  86. across those calls.  Be aware that any non-recharge code must not make calls 
  87. to the serial firmware that will disrupt the background printing process; 
  88. sending the string "^BD" (disable buffering command), for example, is 
  89. guaranteed to confuse a running background printing process.
  90.  
  91.  
  92. Further Reference
  93. o    Apple IIGS Firmware Reference
  94.  
  95.